/*
 *  AMCBinRef.cpp
 *  libavid
 *
 *  Created by Peter on 23.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#include "AMCBinRef.h"
#include "AStream.h"

A_IMPLEMENT_CLASS( 'MCBR', AMCBinRef, AObject );

void AMCBinRef::readFromStream( AStream& str, const AObjDoc& objd )
{
	UInt8 tagMark, version, endTagMark;
	
	str.readPod( tagMark );
	str.readPod( version );
	
	TR_ASSERT( tagMark == 0x02 );
	TR_ASSERT( version == 1 );
	
	str.readPod( _binIdHigh );
	str.readPod( _binIdLow );
	_binName = str.readString();
	
	str.readPod( endTagMark );
	TR_ASSERT( endTagMark == 0x03 );
}


void AMCBinRef::dump( std::ostream& str ) const
{
	str << "AMCBinRef {" << std::endl;
	str << "\t_binIdHigh: " << _binIdHigh << std::endl;
	str << "\t_binIdLow: " << _binIdLow << std::endl;
	str << "\t_binName: \"" << _binName << "\"" << std::endl;
	str << "}" << std::endl;
}